package com.dangz.dans.common;

import org.springframework.context.annotation.Bean;
import org.springframework.http.ResponseEntity;
import org.springframework.web.context.request.async.DeferredResult;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;

//@Configuration
//@EnableSwagger2
public class Swagger {

    /*@Bean
    public Docket sysApi() {
        return new Docket(DocumentationType.SWAGGER_2)
            .groupName("dangz_v1.0")
            .genericModelSubstitutes(DeferredResult.class)
            .genericModelSubstitutes(ResponseEntity.class)
            .useDefaultResponseMessages(false)
            .forCodeGeneration(true)
            .pathMapping("/")// base，最终调用接口后会和paths拼接在一起
            .select()
            .paths(or(regex("/dangz/.*")))//过滤的接口
            .build()
            .apiInfo(sysApiInfo());
    }
    private ApiInfo sysApiInfo() {
        ApiInfo apiInfo = new ApiInfo("测试",//大标题
                "业务接口",//小标题
                "1.0",//版本
                "NO terms of service",
                "dangz Team",//作者
                "",//链接显示文字
                ""//网站链接
        );

        return apiInfo;
    }*/

}
